<?php 
	

define('CODE_SERVER','ftp://mrhanta:242132@123.58.175.155:32212');

class Code{
	
	//FTP_ASCII;
	//FTP_BINARY;
	
	public static function deploy($remote,$local){
		
		$urlparts=parse_url(CODE_SERVER);
		
		$ftp=ftp_connect($urlparts['host'],$urlparts['port'],90);
		
		if($ftp){
			if(ftp_login($ftp,$urlparts['user'],$urlparts['pass'])){
				ftp_pasv($ftp,true);
			}	
		}
		
		if(ftp_put($ftp,$remote,$local,FTP_ASCII)){
			return true;
		}else{
			return false;
		}
		
		ftp_close($ftp);
	
	}
}


?>